package com.taihua_tech.basic.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.annotation.WebListener;

import org.springframework.web.util.Log4jConfigListener;

@WebListener
@SuppressWarnings("deprecation")
public class ServletContextListener extends Log4jConfigListener {
	
	@Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("ServletContex销毁");
    }

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("ServletContex初始化");
        System.out.println(sce.getServletContext().getServerInfo());
        //初始化log4j的路径
        String logPath=sce.getServletContext().getRealPath("/");
    	System.setProperty("logPath",logPath); 
    }
    
	
}
